]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't mix GJS and GObject signal systems
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 14 Feb 2017 17:24:50 +0000 (18:24 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 15 Feb 2017 22:20:14 +0000 (23:20 +0100)
GJS implements a basic signal system that allows monkey-patching
JS objects with signal methods resembling the GObject ones. However
it's clearly not a good idea to replace the actual GObject methods,
so use the proper GObject facilities when inheriting from GObject.

https://bugzilla.gnome.org/show_bug.cgi?id=778660

js/ui/appDisplay.js
js/ui/edgeDragAction.js
js/ui/windowManager.js

index 5b48d5e6e328ea112a451912d825a9cbcd13e0c4..7ebd968d82d68dedaa54d7fce810c4d476d67cc9 100644 (file)
@@ -899,6 +899,8 @@ const ControlsBoxLayout = Lang.Class({
 const ViewStackLayout = new Lang.Class({
     Name: 'ViewStackLayout',
     Extends: Clutter.BinLayout,
+    Signals: { 'allocated-size-changed': { param_types: [GObject.TYPE_INT,
+                                                         GObject.TYPE_INT] } },
 
     vfunc_allocate: function (actor, box, flags) {
         let availWidth = box.x2 - box.x1;
@@ -909,7 +911,6 @@ const ViewStackLayout = new Lang.Class({
         this.parent(actor, box, flags);
     }
 });
-Signals.addSignalMethods(ViewStackLayout.prototype);
 
 const AppDisplay = new Lang.Class({
     Name: 'AppDisplay',
index 5fc4e72574c65c84c2e84eac63a8ca966fe75e8d..115b89cdc2c43383893b89115a1eca5f8be9fe73 100644 (file)
@@ -14,6 +14,7 @@ const DRAG_DISTANCE = 80;
 const EdgeDragAction = new Lang.Class({
     Name: 'EdgeDragAction',
     Extends: Clutter.GestureAction,
+    Signals: { 'activated': {} },
 
     _init : function(side, allowedModes) {
         this.parent();
@@ -81,4 +82,3 @@ const EdgeDragAction = new Lang.Class({
             this.emit('activated');
     }
 });
-Signals.addSignalMethods(EdgeDragAction.prototype);
index 324927f6886cd4f266a8400ad17aadf0723578c6..79b2092a0ed4c3ca9f80c4cb42d785c01bb652d4 100644 (file)
@@ -554,6 +554,7 @@ Signals.addSignalMethods(TouchpadWorkspaceSwitchAction.prototype);
 const WorkspaceSwitchAction = new Lang.Class({
     Name: 'WorkspaceSwitchAction',
     Extends: Clutter.SwipeAction,
+    Signals: { 'activated': { param_types: [Meta.MotionDirection.$gtype] } },
 
     _init : function() {
         const MOTION_THRESHOLD = 50;
@@ -591,11 +592,11 @@ const WorkspaceSwitchAction = new Lang.Class({
         this.emit('activated', dir);
     }
 });
-Signals.addSignalMethods(WorkspaceSwitchAction.prototype);
 
 const AppSwitchAction = new Lang.Class({
     Name: 'AppSwitchAction',
     Extends: Clutter.GestureAction,
+    Signals: { 'activated': {} },
 
     _init : function() {
         this.parent();
@@ -657,7 +658,6 @@ const AppSwitchAction = new Lang.Class({
         return true;
     }
 });
-Signals.addSignalMethods(AppSwitchAction.prototype);
 
 const ResizePopup = new Lang.Class({
     Name: 'ResizePopup',